package fr.u.psud.polytech.view;

import java.util.Set;

import fr.u.psud.polytech.controller.UserManager;
import fr.u.psud.polytech.database.Action;
import fr.u.psud.polytech.database.User;
import fr.u.psud.polytech.controller.UserManager;
public class LinkGenerator {
	public String getLinkGenerator(String login)
	{
		String ret = "";
		//TODO on recupere l'utilisateur grace a son login
		UserManager um = new UserManager();
		
		User user = um.getUser(login);
		Set<Action> action = user.getListAction();
		
		for(Action a : action)
		{
			ret += "<a href=\"/GestionnaireDeStock/"+a.getUrl()+"\">"+a.getNom() +"</a>\r\n";
		}
		
		ret += "<a href=\"/GestionnaireDeStock/Disconnect.jsp\">Deconnexion</a>\r\n";
		
		return ret;
	}
}